package yhao.demo.web.firstWeb.controller.openapi;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yhao.demo.web.firstWeb.config.ApiSwaggerTags;
import yhao.demo.web.firstWeb.controller.WebBaseController;
import yhao.demo.web.firstWeb.remote.PersonManagerRemote;
import yhao.infra.apilist.validate.IdForm;

import javax.annotation.Resource;

/**
 * 人员记录门面层Controller
 * Created by yoara on 2019-03-28
 * //自行修改swagger，权限标识
 */
@Lazy
@RestController
@RequestMapping(value = "/openapi", produces = {"application/json;charset=UTF-8"})
@Api(value = ApiSwaggerTags.DEMO_TAG)
public class OpenController extends WebBaseController {
    @Resource
    private PersonManagerRemote personManagerRemote;

    @GetMapping(value = "/showNameById")
    @ApiOperation(value = "获取人员名称")
    @ApiResponses({
            @ApiResponse(message = "获取人员名称", code = 200, response = String.class)
    })
    public String showNameById(IdForm form) {
        return successInfo(personManagerRemote.showNameById(form));
    }
}
